package com.hxx.day7.simple.controller;

import com.hxx.day7.simple.domain.User;
import com.hxx.day7.simple.service.UserService;
import com.hxx.day7.simple.service.impl.UserServiceImpl;

import java.util.List;

public class UserContoller {
    private UserService userService = new UserServiceImpl();

    /**
     * 新增用户
     */
     public void save(User user){
        userService.save(user);
    }
      /**
       * 更新用户
       */
      public void update(User user){
        userService.update(user);
      }
      /**
       * 删除用户
       */
      public void delete(Integer id){
        userService.delete(id);
      }
      /**
       * 查询所有用户
       */
      public List<User> findAll(){
        return userService.findAll();
      }
}


















